1. Field of the Invention
The present invention relates to a method for detecting data outputted from an optical coupler, and, in particular, to a method for detecting data outputted from the optical coupler by the use of an analog-to-digital converter.
2. Description of the Related Art
FIG. 1 illustrates a prior art circuit for detecting data outputted from an optical coupler. Through a resistor R2, input signal Vs turns on a light emitting diode within the optical coupler 112, causing the diode to emit light. In response to the light, a photo-transistor within the optical coupler 112 is turned on, providing a ground path to supply voltage Vcc. The optical coupler 112 can thus be turned on or off by the input signal Vs to provide an output signal Vin to a microprocessor unit (MPU) 110.
The MPU 110 detects the level of the signal Vin, and senses whether it is logic high or low based on a predetermined reference level, e.g., 2.5V. The MPU 110 recognizes the level of the inputted signal Vin as a logic high level, if the level is greater than 2.5V. The MPU 110 recognizes the level as a logic low level, if the level is less than 2.5V.
FIG. 2 illustrates in graphic form the detection of data outputted from the prior art optical coupler circuit. The MPU 110 receives the input signal Vin and recognizes a signal Vp corresponding with the signal Vin. The signal Vp conveys the level of the signal Vin outputted from the prior art optical coupler circuit at various points. If the signal Vin at a given point is greater than 2.5V, then the data at that point has a logic high level. If the signal Vin at a given point is less than 2.5V, then the data at that point has a logic low level.
As described above and illustrated by FIGS. 1 and 2, the optical coupler 112 is used for transferring logic information carried by a signal by the use of light instead of electricity. The optical coupler 112 is an optoelectric device that takes advantage of both the digital processing capabilities of electronics and communications capabilities of the optical domain. It is a digital active optical logic device with high and low light-emitting output states corresponding to electrical states of high impedance (low optical output) or low impedance (high optical output). The optical coupler 112 is also used to check whether the input signal Vs exists. If the diode within the optical coupler 112 is turned on, then the signal Vs exists. If the diode is not turned on, then the signal Vs does not exist.
Despite the loss of power in conversions of electrical energy to optical and optical to electrical energy and the imbalances inherent in an optical communication system, transmission of light signals instead of electrical signals have known advantages such as no EMI interference, and large transmission bandwidths.
Nonetheless, the prior art optical coupler circuit suffers from occasional erroneous level detection because Vin outputted from the optical coupler 112 is recognized by the MPU 110 with only one reference level. For example, a logic high Vin which deviates below the reference level at the time of detection, depending on the level of signal Vs and the value of R1, will be recognized as logic zero by the MPU 110. For example, in FIG. 2 the level of signal Vin at point A is recognized as logic zero by the MPU 110 because it is less than the reference level.
Consequently, in accordance with the feature of transferring the signal Vin of the optical coupler 112, the value of the resistor R1 in the optical coupler circuit of the prior art should be changed depending on the application in order to perform stable conversion and transfer operations of signal Vs and have the level of signal Vin correctly recognized by the MPU 110 at all points in the signal.